This file will simulate the chances of your party getting hit with a tier three knowledge bomb after a certain number of turns. You start at tier zero, and the chances of leveling up each round are as follows:
0 => 1: 255/256
1 => 2: 50%
2 => 3: 25%

Basically, the AI learns what monsters are immune to after you hit level 3 and they will stop casting spells that have no chance of working.

TurnLv 1Lv 2Lv 3
10.9958500.0006
20.999990.500630.0006
3(1 I)10.748160.12586
410.874720.2826
510.937950.42956
6(2 I)10.968380.55691
710.984230.65983
810.991660.74054
9(3 I)10.995870.80342
1010.997870.85116
1110.998830.88752
12(4 I)10.999360.91572
1310.999750.93657
1410.999830.95259
15(5 I)10.999910.96382
1610.999950.9728
1710.999960.97957
18(6 I)10.999970.98483
1910.999980.98858
20110.99136
21(7 I)110.99372
22110.99534
23110.9966
24(8 I)110.99759
25110.99832
26110.99893
27(9 I)110.99927
28110.9996
29110.99985
30(10 I)111



And again, with +1/256 to each chance.
TurnLv 1Lv 2Lv 3
1100.00038
210.505920.00038
3(1 I)10.754430.12875
410.877110.2871
510.939580.43649
6(2 I)10.969910.56486
710.985220.66884
810.992770.74905
9(3 I)10.996290.81118
1010.99830.85846
1110.999070.89456
12(4 I)10.999510.92148
1310.99980.94077
1410.999880.95534
15(5 I)10.999930.96675
1610.999960.97512
1710.999970.98163
18(6 I)10.999990.98641
19110.99003
20110.99267
21(7 I)110.99464
22110.9962
23110.99732
24(8 I)110.99808
25110.99875
26110.9991
27(9 I)110.99941
28110.99963
29110.99986
30(10 I)111